# queue.LifoQueue(maxsize=0)
"""
    LIFO后进先出队列
    maxsize参数设置和功能与Queue一样
"""

from queue import Queue, LifoQueue, PriorityQueue

queue_obj = LifoQueue()  # 创建一个LIFO(后进先出)队列对象

for i in range(4):
    queue_obj.put(i)
while not queue_obj.empty():
    print(queue_obj.get())